import {request} from "./http-base";
import {getReportByQuestionnaireUrlBuilder,getReportListUrl} from "../apis";
import {TaroResponseWrapper} from "../types";

interface Suggestion{
  content: string; // 建议正文
  flag: string;
  title: string; // 建议标题
}
export interface Report {
  result:string;// 报告正文
  title:string;// 报告标题
  type:"XUETANG"|"XUEYA"|"XUEZHI"|"OTHER";
  pageId:number; // 生成报告的问卷 ID
  id:number; // 报告 ID
  items:Suggestion[]; // 建议
}

export const getReportByQuestionnaireId = async (pageId: number): Promise<TaroResponseWrapper<Report>> => {
  return request(getReportByQuestionnaireUrlBuilder(pageId), {}, "GET");
}


export const getReportList = async (): Promise<TaroResponseWrapper<Report>> => {
  return request(getReportListUrl, {}, "GET");
}
